﻿using System;
using System.ComponentModel;

namespace ScanSnap.Domain
{
    public class FileEntry //: INotifyPropertyChanged 
    {
        public string Name { get; set; }
        public string FullName { get; set; }
        public bool ReadOnly { get; set; }
        public bool IsSelected { get; set; }
        public string DateCreated { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
       
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(info));
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;

            try
            {
                return Name.Equals((obj as FileEntry).Name);
            }
            catch (Exception)
            {
                return false;
            }
        }

        public override int GetHashCode()
        {
            return 17; //bad
        }

        public override string ToString()
        {
            return Name.ToString();
        }
    }
}
